<?php
/*
<Model Information> 
Author: Naseer Ahmad
Date: 23-10-2011
Last Updated on:
*/


class listingsModel extends appModel
{
	var $name = 'listingsModel';
	
	function getAds($criteria){
		$ads = $this -> _getArrayData("adsInfo", "*", $criteria);
		
		for($i=0; $i<count($ads);$i++){
			$ads[$i]['adImage']=$this -> _getSingleData("adImages", "imageName", "adID=".$ads[$i]['adID']." limit 1");
			$ads[$i]['cityName']=$this -> _getSingleData("city", "cityName", "cityID=".$ads[$i]['cityID']." limit 1");
		}
		
		return $ads;
		
	}
	
}

?>